import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MemberCenterHomeComponent } from './member-center-home/member-center-home.component';
import { DepartmentComponent } from './administrator/department/department';
import { PersonnelComponent } from './administrator/personnel/personnel';
import { DepartmentUpdateComponent } from './administrator/department/departmentUpdate';
import { PrescriptionAuditedComponent } from './prescription/auditedList/auditedList';
import { PrescriptionAuditingComponent } from './prescription/auditingList/auditingList';

const routes: Routes = [
    {
        path: '',
        children: [
            {
                path: '',
                redirectTo: 'home',
            },
            {
                path: 'home',
                component: MemberCenterHomeComponent,
                data: {
                    title: '医生中心',
                    url: 'memberCenter/home'
                }
            },
            {
                path: 'administrator/department',
                component: DepartmentComponent,
                data: {
                    title: '部门管理',
                    url: 'administrator/department'
                }
            },
            {
                path: 'administrator/departmentUpdate/:id',
                component: DepartmentUpdateComponent,
                data: {
                    title: '部门管理',
                    url: 'administrator/department'
                }
            },
            {
                path: 'administrator/departmentAdd',
                component: DepartmentUpdateComponent,
                data: {
                    title: '部门管理',
                    url: 'administrator/department'
                }
            },
            {
                path: 'administrator/personnel',
                component: PersonnelComponent,
                data: {
                    title: '人员管理',
                    url: 'administrator/personnel'
                }
            },
            {
                path: 'prescription/auditedList',
                component: PrescriptionAuditedComponent,
                data: {
                    title: '已审核处方列表',
                    url: 'prescription/auditedList'
                }
            },
            {
                path: 'prescription/auditingList',
                component: PrescriptionAuditingComponent,
                data: {
                    title: '处方审核列表',
                    url: 'prescription/auditingList'
                }
            },
            {
                path: '**',
                redirectTo: 'getCash',
            },
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class MemberCenterRoutingModule { }
